% construct diffusion and random force part
function rest = randomXOU(t,~,num)

load('alphas'); load('betas'); 
load('sigma');   load('msval');
betarow=size(betas,1); alpharow=size(alphas,1);
row=alpharow*betarow;
if row >=2
    rest(row)=0;
end
dt1=0.5/num; 
t2courseindex=floor((t+0.5*dt1)/dt1)+1;
% alpha=0 
%%beta=0
rest(1)=-1/2*sum(sig(t2courseindex).^2,2);
%%beta!=0
rest(2:betarow)=-sig(t2courseindex,1)*sig(t2courseindex,2:betarow);
% alpha!=0
%%alpha=1
%rest(betarow+1:2*betarow)=sig(t2courseindex,1:betarow)*ms{1}(t);
%%alpha=k
for k=2:alpharow
    rest(betarow*(k-1)+1:k*betarow)=sig(t2courseindex,1:betarow)...
        *msval(t2courseindex,k-1);
end
rest=rest';




